//
//  NomalNewsTableViewCell.m
//  Four_years
//
//  Created by 张跃骞 on 15/11/11.
//  Copyright © 2015年 中软三班四年小组. All rights reserved.
//

#import "NomalNewsTableViewCell.h"

@implementation NomalNewsTableViewCell

- (instancetype)init {
    if (self = [super init]) {
        _isRead = NO;
        
        _newsImage = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 90, 65)];
        [self.contentView addSubview:_newsImage];
        
        _newsTitle = [[UILabel alloc] initWithFrame:CGRectMake(108, 10 + 3, WIDTH - 108 - 15, 22)];
        _newsDetail.font = [UIFont systemFontOfSize:15 weight:.0028];
        [self.contentView addSubview:_newsTitle];
        
        _newsDetail = [[UILabel alloc] initWithFrame:CGRectMake(108, 10 + 22 + 10 - 9, WIDTH - 108 - 10, 50)];
        _newsDetail.numberOfLines = 0;
        _newsDetail.textColor = [UIColor colorWithWhite:0.7 alpha:1];
        _newsDetail.font = [UIFont systemFontOfSize:14 weight:.0028];
        [self.contentView addSubview:_newsDetail];
        
        _followUpPost = [[FollowUpPostLabel alloc] initWithCenter:CGPointMake(WIDTH - 33, 85 - 18)];
        [self.contentView addSubview:_followUpPost];
    }
    return self;
}

- (void)setNewsImage:(NSString *)imageName newsTitle:(NSString *)newsTitle newsDetail:(NSString *)newsDatail followUpPost:(NSInteger)followUpPostNumber {
    _newsImage.image = [UIImage imageNamed:imageName];
    _newsTitle.text = newsTitle;
    _newsDetail.text = newsDatail;
    _followUpPost.text = [NSString stringWithFormat:@"%ld跟帖",(long)followUpPostNumber];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
